 #if defined(__PCH__)
   /* if 18F4550 */
   /* do nothing */
 #else
   /* if 16F628A */
   #use delay(internal=4M)
   #use rs232(baud=9600, bits=8,xmit=PIN_B2,rcv=PIN_B1)
 #endif

/* External functions */
extern void delay_ms(int);
extern void putc(char);
extern void printf(char*, char*);
extern void gets();

#define maxDataSize 50

/* this function prints a char in a cell */
int outCell(char data,int16 pin){
   
   register int i;

   data = (data & 127);
 
   for(i=0;i<data;i++){
      
      output_high(pin);
      output_low(pin);   
   }

}

/* this function prints on a CI */
int outCi(char *data,int16 *outputs){

   char tmp[50];
   register int i;


   while(*outputs!='\0'){
      
      if(*data=='\0')
         return 0;
      
      outCell(*data,*outputs);
      outputs++;
      data++;
   }

   while(data!='\0'){
      tmp[i] = *data;
      data++;
      i++;
   }

   printf("%s",tmp);
   return 1;
}

/* this function recives the data of another C1 */
inCi(char *data){
      gets(data);
      return 0;
}

